﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/MasterAdmin.master" AutoEventWireup="true"
    CodeFile="UpdateProduct.aspx.cs" Inherits="Admin_UpdateProduct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
             <table style="width: 100%;">
        <tr>
            <th>
                Update product
            </th>
        </tr>
        <tr>
            <td>
                Category :
            </td>
            <td>
                <asp:DropDownList ID="ddlCategory"
                    runat="server" DataTextField="cName" DataValueField="cId">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ShopConnectionString %>"
                    SelectCommand="SELECT [cId], [cName] FROM [Categories] WHERE ([cActive] = @cActive)">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="true" Name="cActive" Type="Boolean" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                Product Code :
            </td>
            <td>
                <asp:TextBox ID="txtProduct" runat="server" Enabled="False"></asp:TextBox>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                Name :
            </td>
            <td>
                <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtname" ErrorMessage="Required Name" 
                    ForeColor="Red"></asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                Small Image :
            </td>
            <td>
                <asp:FileUpload ID="fuSmall" runat="server" onload="fuSmall_Load"  Visible="false"/>
                <asp:Image ID="imgSmall" runat="server" Height="100px" Width="100px" />
            </td>
            <td>
             &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                Big Image :
            </td>
            <td>
                <asp:FileUpload ID="fuBig" runat="server" Visible="false" />
                 <asp:Image ID="imgBig" runat="server" Height="100px" Width="100px" />
            </td>
            <td>
               
            </td>
        </tr>
        <tr>
            <td>
                Description :
            </td>
            <td>
                <asp:TextBox ID="txtDes" runat="server" Height="49px" TextMode="MultiLine" Width="189px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="txtDes" ErrorMessage="Required Description" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                Quantity</td>
            <td>
                        <asp:TextBox ID="txtQuantity" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="txtQuantity" ErrorMessage="Required Quantity" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" 
                            ControlToValidate="txtQuantity" ErrorMessage="Number" ForeColor="Red" 
                            Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                            ControlToValidate="txtQuantity" ErrorMessage="Number between 1 and 1000" 
                            ForeColor="Red" MaximumValue="1000" MinimumValue="1" 
                    Type="Integer"></asp:RangeValidator>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                Price :
            </td>
            <td>
                <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                            ControlToValidate="txtPrice" ErrorMessage="Required Price" 
                    ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="CompareValidator2" runat="server" 
                            ControlToValidate="txtPrice" ErrorMessage="Number" ForeColor="Red" 
                            Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
                        <asp:RangeValidator ID="RangeValidator2" runat="server" 
                            ControlToValidate="txtPrice" ErrorMessage="Number between 1000 and 1000000000" 
                            ForeColor="Red" MaximumValue="100000000" MinimumValue="1000" 
                            Type="Integer"></asp:RangeValidator>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                Active :
            </td>
            <td>
                <asp:CheckBox ID="chkActive" runat="server" />
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="btnUpdate" runat="server" OnClick="btnAdd_Click" Text="Update" />
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                    onclick="btnSubmit_Click" />
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                    Text="List Product" />
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
        </ContentTemplate>
    </asp:UpdatePanel>
   
</asp:Content>
